package com.city.repository.supervise;

import com.city.domain.supervise.ImpThing;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author: Xln_z
 * @date: 2018/8/24
 * @decription:
 **/

@Repository
public interface ImpThingRepository extends JpaRepository<ImpThing, Integer> {

    @Query(value = "select * from imp_thing_manage limit ?1,?2 ", nativeQuery = true)
    List<ImpThing> getImpThingLimit(Integer limitPage, Integer limitNum);

    @Query(value = "select * from imp_thing_manage where (thing_name like %?3% or tellphone like %?3%) limit ?1,?2 ", nativeQuery = true)
    List<ImpThing> getImpThingLimit(Integer limitPage, Integer limitNum, String search);

}
